<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>Title</title>
        <script>
            function f1() {

                var s="Fsadf123fsa3242345sdfsdfsdaf432ojjasdfj";


                console.log(s.length);

                console.log(s.charAt(3));
                console.log(s.substring(3,6));
                console.log(s.indexOf("f"));
                console.log(s.lastIndexOf("f"));

                console.log(s.toUpperCase());

                console.log("     sadfsadf sdf sdf s dfsdfsd    ".trim());

                console.log(s.replace(/f/,"X"));
                console.log(s.replace(/f/g,"X"));
                console.log(s.replace(/f/gi,"X"));
                console.log(s.replace(/\d/g,"X"));
                console.log(s.replace(/\d+/g,"X"));

                var s2="15932587891,18915967895,18125698789,13789897807";

                console.log(s2.replace(/(\d{3})(\d{5})(\d{3})/g,"$1*****$3"));

                console.log(s.match(/\d+/g));

                console.log(s.search(/\d+/g));

            }
            function f2(){
                var reg=/^\d{3,4}-\d{8}/;

                var str="025-12345678";

                console.log(reg.test(str));

            }
        </script>
    </head>
    <body>
        <a href="javascript:;" onclick="f1();">test1</a>
        <a href="javascript:;" onclick="f2();">test2</a>
    </body>
</html>